﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace teamtest
{
    /// <summary>
    /// This class can tell you what is number you mean
    /// </summary>
    class Onodi : Knowledge    
    {
        public override void DoWhatYouCan()
        {
            Console.WriteLine("Choose a number between 0 and 1, and I will guess. Press ENTER if you are ready");
            string true_or_false; ///< This string will include the users answer
            
            Console.WriteLine("Is it 0? (Y/N)");
            do
                {
                    true_or_false = Convert.ToString(Console.ReadLine());
                } while (IsItTheRightAnswer(true_or_false));
            if (true_or_false == "Y" || true_or_false == "y") { Console.WriteLine("Your thinked number is the 0!"); }
             else { Console.WriteLine("Your thinked number is the 1!"); }
        }

        /// <summary>
        /// This function will return true if you press 'Y', 'y', 'N', 'n'  
        /// </summary>
        /// <returns></returns>
        /// <param name="str">This string will include the users answer</param>
        public bool IsItTheRightAnswer(string str)
        {
            if (!((str == "Y" ) || (str == "y") || (str == "n") ||  (str == "N"))) {return true;}
            else {return false;}
        }

    }
}
